using System;

namespace Headspring.Training.Domain.Model
{
	public class WorkOrder
	{
		private Guid _id;
		private string _title = "";
		private string _description = "";
		private WorkOrderStatus _status = WorkOrderStatus.Draft;
		private Employee _creator;
		private Employee _assignee;
		private DateTime? _createdDate;
		private DateTime? _completedDate;
		private string _number;

		public WorkOrder()
		{
		}

		public virtual Guid Id
		{
			get { return _id; }
			set { _id = value; }
		}

		public virtual string Title
		{
			get { return _title; }
			set { _title = value; }
		}

		public virtual string Description
		{
			get { return _description; }
			set { _description = value; }
		}

		public virtual WorkOrderStatus Status
		{
			get { return _status; }
			set { _status = value; }
		}

		public virtual Employee Creator
		{
			get { return _creator; }
			set { _creator = value; }
		}

		public virtual Employee Assignee
		{
			get { return _assignee; }
			set { _assignee = value; }
		}

		public virtual DateTime? CreatedDate
		{
			get { return _createdDate; }
			set { _createdDate = value; }
		}

		public virtual DateTime? CompletedDate
		{
			get { return _completedDate; }
			set { _completedDate = value; }
		}

		public virtual string Number
		{
			get { return _number; }
			set { _number = value; }
		}

		public virtual string FriendlyStatus
		{
			get { return getTextForStatus(); }
		}

		protected virtual string getTextForStatus()
		{
			return Status.ToString();
		}

		public override string ToString()
		{
			return "Work Order " + Number;
		}
	}
}